package challenge._2021;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

/**
 * @author 挚爱之夕
 * @version 1.0
 * @implSpec
 *
 * @since 2022 - 11 - 17 - 14:44
 */
public class _06火眼金睛练成计 {
    public static void main(String[] args) {

    }
}
class Main6{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int temp = N;
        int cnt = 0;
        String username, password;
        //因为先打印的是修改的账号数，要保存一下
        List<String> list = new LinkedList<>();
        while(temp-- > 0){
            username = sc.next();
            password = sc.next();
            if(check(password)){
                cnt++;
                list.add(get(username, password));
            }
        }
        if(cnt == 0){
            if(N == 1){
                System.out.printf("There is %d account and no account is modified", N);
            }else{
                System.out.printf("There are %d accounts and no account is modified", N);
            }
        }else{
            System.out.println(cnt);
            for(String line : list){
                System.out.println(line);
            }
        }
    }
    static boolean check(String password){
        return password.contains("1") || password.contains("0") || password.contains("l") || password.contains("O");
    }
    static String get(String username, String password){
        StringBuilder builder = new StringBuilder();
        builder.append(username).append(" ");

        for(char c : password.toCharArray()){
            if(c == '1'){
                builder.append('@');
            }else if(c == '0'){
                builder.append('%');
            }else if(c == 'l'){
                builder.append('L');
            }else if(c == 'O'){
                builder.append('o');
            }else{
                builder.append(c);
            }
        }
        return builder.toString();
    }
}